#!/usr/bin/python
import socket,traceback
import os,time
import json,threading

class Child_sock:
    def __init__(self,host,port):
        try:
            self.sock = socket.socket(socket.AF_INTE,socket.SOCK_STREAM)
            self.sock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
            self.sock.bind((host,port))
            self.sock.listen(1)
        except socket.error ,e:
            print "Net connecting error : %s" %e
    def listen(self):
        while True:
            try:
                clientsocket ,clientaddr = self.sock.accept()
            except KeyboardInterrupt :
                raise
            except socket.error, e :
                print "client error : %s" %e
            
        
